<?php
	class video{
		protected $_domain = '';
		protected $_link;
		protected $_errors;
		public $_alias;
		
		public function setLink($link){

			$pattern = '@^' . $this->_domain . '@';
			preg_match($pattern, $link, $matches);

			if($matches){
				$this->_link = $link;
			}
		}
		
		public function getLink($link){
			return $this->_link;
		}
		
		/*
		 *  return array of param from the url
		 */
		public function getQueryParams(){
			$url = parse_url($this->_link);
			$queryString = parse_str($url['query'], $params);
			return $params;
		}
		
		public function getErrors(){
			return $this->_errors;
		}
		
		public function isError(){
			if($this->_errors)
				return true;
			else
				return false;
		}
	}